/**********************************************************************************
 * Copyright (c) 2012 - 2012,  parallel, All right reserved
 * Title: com.adc.parallel.pool  ThreadPoolFactory.java 
 * @author shen  shenqiao2012@163.com 
 *  2012-11-19 上午9:58:58 
 **********************************************************************************/


package com.adc.parallel.pool;

import com.adc.litepool.base.BasePoolableObjectFactory;



public class ThreadPoolFactory extends BasePoolableObjectFactory{
	/**
	 * Singleton
	 */
	private static ThreadPoolFactory instance=null;
	
	/**
	 * 
	 * Description: Singleton, return 基础池化对象管理工厂的单例
	 * author:  shen
	 * @return ThreadPoolFactory 
	 */
	public static ThreadPoolFactory getInstance() {
		if (instance==null) {
			instance=new ThreadPoolFactory();
		}
		return instance;
	}
	
	/**
	 * Description:  destory object
	 * @see com.adc.litepool.base.BasePoolableObjectFactory#destroyObject(java.lang.Object) 
	 */
	@Override
	public synchronized void destroyObject(Object obj) {
		// TODO Auto-generated method stub
		super.destroyObject(obj);
		super.clearObject(obj);
	}
	
//	/**
//	 * Description:  对象在使用过程中内部状态会发生变化，当归还对象池时可能需要将对象还原为原始状态
//	 * @see com.adc.litepool.base.BasePoolableObjectFactory#clearObject(java.lang.Object) 
//	 */
//	public Object clearObject(Object obj) {
//		obj=null;
//		return new BaseThread();
//	}
	
}
